package com.czxy.controller;

import com.czxy.domain.Customer;
import com.czxy.service.CustomerService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/customer")
public class CustomerController {


    @Resource
    private CustomerService customerService;

    @RequestMapping("/findAll")
    public  String findAll(Model model){

        List<Customer> list = customerService.findAll();
        model.addAttribute("list",list);
        return "customer/list";
    }

}
